package edu.sctu.zhengsenwen.month201506.day20150611.Array;

/**
 * Created by user15 on 2015/6/12.
 */
public class C04E07 {

    public static void main(String[] args) {

        char a[] = new char[20];
        char ch = 0;

        int i = 0;
        int j = 0;
        int sum = 0;

        System.out.println("请输入一串字符：");

        try {
            while (ch != 'n') {
                ch = (char) System.in.read();
                a[i] = ch;
                i++;
            }
        } catch (Exception e) {}

        System.out.println("输入的字符串为：");

        for (j = 0; j < i; j++) {
            switch (a[j]) {

                case 'a':
                case 'e':
                case 'i':
                case 'o':
                case 'u':
                    sum++;
                    break;
            }
            System.out.println(a[j]);
        }

        System.out.println("共有元音字母：" + sum + "个！");
    }
}
